<?php
namespace app\libs;

use Afu\HtmlFilter;

class Html {
    public function pure($html) {
        $f = new HtmlFilter();

        $f->allowedTags = [
            'a' => ['href' => 1, 'target' => 1],
            'img' => ['src' => 1],
            'p' => ['data-role' => 1],
            'video' => ['src' => 1, 'poster' => 1, 'controls' => 1],
            'mark' => ['data-id' => 1],
            'b' => null,
            'strong' => null,
            'hr' => null,
            'h2' => null,
            'div' => null,
            'blockquote' => null
        ];

        return $f->filter($html);
    }
}
